home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <!-- ===========================================================
- Category: XSLT
- Sub-category: xsl:output
- Author: David Silverlight
- HeadGeek@xmlpitstop.com
- Created: 2001-05-16
- Description:-
- This stylesheet processes a set of XML elements and displays
- the result in XML. This is accomplished using the output
- method of XML as shown above. In this example, we are
- taking the original xml elements and creating a new xml
- document sorted by name.
- =============================================================== -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
-
- <!-- Note: The following XSLT method is required to specify the output type of XML -->
- <xsl:output method="xml"/>
-
-
-
- <!-- Template for root rule -->
- <xsl:template match="/">
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <!-- Template for "employees" elements -->
- <xsl:template match="employees">
- <!--This stylesheet processes a set of XML elements and
- displays the result in XML. This is accomplished using the output method of XMl as
- shown above. In this example, we are taking the original xml elements and
- creating a new xml document sorted by name-->
- <emloyees>
- <xsl:for-each select="employee" >
- <xsl:sort select="employeename" order="ascending" />
-
-
- <employee>
- <xsl:copy-of select="department" />
- <xsl:copy-of select="employeename" />
- <xsl:copy-of select="hourlyrate" />
- <xsl:copy-of select="primarylanguage" />
- </employee>
-
-
- </xsl:for-each>
- </emloyees>
- </xsl:template>
-
-
-
- </xsl:stylesheet>